package masterSpringMvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("aaaaaaa")
public class HelloController {
	@RequestMapping("/")
	public String hello(Model model)
	{
		model.addAttribute("message","hahah");
		return "resultPage";
	}
	
	@RequestMapping("/index")
	public String index(@RequestParam(value="name",required=false) String userName,Model model)
	{
		model.addAttribute("message","hello,"+userName);
		return "resultPage";
	}
}
